package com.catchu.pattern.creational.迭代器模式.a入门;

import com.catchu.pattern.creational.迭代器模式.a入门.aggregate.ConcreteAggregate;
import com.catchu.pattern.creational.迭代器模式.a入门.iterator.ConcreteIterator;

public class Client {
    public static void main(String[] args) {
        String[] params = {"张三","李四","王五"};
        ConcreteAggregate aggregate = new ConcreteAggregate(params);

        ConcreteIterator iterator = new ConcreteIterator(aggregate);
        iterator.first();
        while (!iterator.isDone()){
            System.out.println(iterator.currentItem());
            iterator.next();
        }
    }
}
